﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Traceability.App.Infrastructure.Migrations
{
    /// <inheritdoc />
    public partial class _1 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "Basic_Traceability",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    GoodsId = table.Column<int>(type: "int", nullable: false),
                    Production_Batch = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Quality_Guarantee = table.Column<int>(type: "int", nullable: false),
                    Production_License = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Manufacturing_Enterprise = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Information_Completeness = table.Column<int>(type: "int", nullable: false),
                    Cover_Image = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Creator = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Reviser = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Basic_Traceability", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "Breeding_Information",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Breed_Type = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Source_Origin = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Feeding_Days = table.Column<int>(type: "int", nullable: false),
                    Feed_Brand = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Breeding_Supervisor = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Release_Date = table.Column<DateTime>(type: "datetime2", nullable: false),
                    Production_Batch = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Breeding_Information", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "Company_Information",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Livestock_Farm = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Farm_Manager = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Inventory_Quantity = table.Column<int>(type: "int", nullable: true),
                    Corporate_Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Province = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Location_City = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Detailed_Address = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Establishment_Date = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Company_Profile = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Production_Batch = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Company_Information", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "Goods_Information",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    GoodsName = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Goods_Information", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "Immune_Information",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Feeding_Days = table.Column<int>(type: "int", nullable: false),
                    Immune_System = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Immune_Methods = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Production_Batch = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Immune_Information", x => x.Id);
                });

            

            migrationBuilder.CreateTable(
                name: "Processing_Information",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Corporate_Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Production_License = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Work_Team = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Responsible_Person = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Production_Batch = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Processing_Information", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "Slaughter_Information",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Batch_No = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Average_Weight = table.Column<int>(type: "int", nullable: false),
                    Arrival_Time = table.Column<DateTime>(type: "datetime2", nullable: false),
                    Slaughter_Time = table.Column<DateTime>(type: "datetime2", nullable: false),
                    Production_Batch = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Creator = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Reviser = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Slaughter_Information", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "Supplier",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    DeepType = table.Column<int>(type: "int", nullable: false),
                    Batch_Number = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Production_Batch = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Supplier", x => x.Id);
                });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "Basic_Traceability");

            migrationBuilder.DropTable(
                name: "Breeding_Information");

            migrationBuilder.DropTable(
                name: "Company_Information");

            migrationBuilder.DropTable(
                name: "Goods_Information");

            migrationBuilder.DropTable(
                name: "Immune_Information");

            migrationBuilder.DropTable(
                name: "Picture_Information");

            migrationBuilder.DropTable(
                name: "Processing_Information");

            migrationBuilder.DropTable(
                name: "Slaughter_Information");

            migrationBuilder.DropTable(
                name: "Supplier");
        }
    }
}
